<!-- 兄弟组件传参  借用父级 -->
<template>
    <div style="background-color: aquamarine;">
        <button @click="emitB">派发一个事件</button>
    </div>
</template>

<script setup lang='ts'>
// import { ref, reactive } from 'vue'
const emit = defineEmits(['on-click'])
let flag = false
const emitB = () => {
    flag = !flag
    emit('on-click', flag)
}


</script>

<style scoped lang="scss"></style>